package de.koller.worlders.gameplay;

import de.koller.oceanFramework.util.ColorIntUtil;
import de.koller.worlders.WSea;
import java.util.HashMap;
import java.util.Map;

public class BuildableTiles extends WSea {

	private Map<Integer, Integer> allowed = new HashMap<>();

	public BuildableTiles() {
		addAllowed( 1, 0, 521 );
	}
	
	public int allowedToBuild( int base, int disp ) {
		Integer key = ColorIntUtil.getIntColor( base, disp, 0, 0 );
		
		Integer value = allowed.get( key );
		if( value == null )
			return 0;
		else
			return value;
	}
	
	public void addAllowed( int base, int disp, int num ) {
		Integer key = ColorIntUtil.getIntColor( base, disp, 0, 0 );
		Integer v = allowed.get( key );
		
		if( v == null )
			allowed.put( key, num );
		else
			allowed.put( key, v + num );
	}
	
}
